package com.test.springboot3.springboot3testdemo1.entity;

import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import jakarta.xml.bind.annotation.XmlRootElement;
import java.util.ArrayList;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * Created with IntelliJ IDEA.
 *
 * @author： liuziyang
 * @date： 2024/7/28-22:16
 * @description：
 * @modifiedBy：
 * @version: 1.0
 */
@XmlRootElement
@Data
@AllArgsConstructor
@NoArgsConstructor
public class User {
  private String id;

  @NotNull
  @Size(min = 5, max = 10)
  private String name;

  @NotNull private Integer age;
  private List<OrderInfo> orderList;

  public User(String id, String name, int age) {
    this.id = id;
    this.name = name;
    this.age = age;
    orderList = new ArrayList<>();
  }
}
